namespace jsWrite {
    function throttle(callback:()=>void | null,timer:number){
        let flag = true
        return function(){
            if(flag){
                flag = false
                requestAnimationFrame(callback)
                setTimeout(() => {
                    flag = true
                }, timer);
            }
        }
    }
}